#include <iostream>
#include <stdio.h>

#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>

#include "2dpet.hpp"
#include "2dpetDynamic.hpp"

bool compute = false;

void onDisplay()
{
	glClearColor(0, 0, 0, 1);
	glMatrixMode(GL_MODELVIEW); glLoadIdentity();
	glMatrixMode(GL_PROJECTION); glLoadIdentity();

	srand(3);
	if (!compute) {
		//Old::Compute();
		Dynamic::Compute();
		compute = true;
	}
}

//--------------------------------------------------------
// The entry point of the application
//--------------------------------------------------------
int main(int argc, char* argv[])
{
	glutInit(&argc, argv);                          // GLUT initialization
	glutInitWindowSize(256, 128);  // Initial resolution of the application Window is 600x600 pixels
	glutInitWindowPosition(100, 100);               // Initial location of the application window
	glutInitDisplayMode(GLUT_RGB);    // Image = 8 bit R,G,B + double buffer + depth buffer
	glutCreateWindow("2dPET");              // Application Window is born
	glutDisplayFunc(onDisplay);                     // Register event handlers
	glutMainLoop();                             // Event loop
	return 0;
}